const { ccclass, property } = cc._decorator;
import EngineUtil from "./EngineUtil";
import GameDataMgr from "./GameDataMgr";
import PageMgr from "./PageMgr";

@ccclass
export default class Agreement extends cc.Component {
    @property
    node_name = "";

    touch_user() {
        PageMgr.showPage("WebPage", {
            type: GameDataMgr.WebUrlType.USER_TYPE
        });
        if (this.node_name !== "user_guide") {
            EngineUtil.setLocalData("first_read_agreement", "1");
        }
    }

    touch_privacy() {
        PageMgr.showPage("WebPage", {
            type: GameDataMgr.WebUrlType.PRIVACY_TYPE
        });
        if (this.node_name !== "user_guide") {
            EngineUtil.setLocalData("first_read_privacy", "1");
        }
    }
}
